package com.lzy.system.organization.entity.security.entity;

import lombok.Data;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

@Data
public class SecurityUser implements UserDetails {
    private Long id;
    private String name;  //姓名
    private String password;  //密码
    private String username;  //用户名
    private boolean accountNonExpired;   //是否没过期
    private boolean accountNonLocked;   //是否没被锁定
    private boolean credentialsNonExpired;  //是否没过期
    private boolean enabled;  //账号是否可用
    private String token_uuid;
    private List<SecurityRole> authorities = new ArrayList<>();

    @Override
    public Collection<? extends GrantedAuthority> getAuthorities() {
        return authorities;
    }
}
